<include file="Common/header-control" />
<div class="row">
    <div class="col-md-12">
        <ul class="nav nav-tabs">
            <li class="active"><a href="{:U('control/user/list')}">用户</a></li>
            <li><a href="{:U('control/user/create')}">新增用户</a></li>
        </ul>
    </div>
    <div class="box col-md-12">
        <div class="box-inner">
            <div class="box-header well" data-original-title="">
                <h2><i class="fa fa-list"></i> 用户列表</h2>
            </div>
            <div class="box-content">
                <if condition="!empty($users)">
                    <div class="table-responsive">
                        <table class="table table-striped">
                            <tr>
                                <th style="min-width:100px;">用户</th>
                                <th style="min-width:200px;">用户组</th>
                                <th style="min-width:300px;">状态</th>
                                <th style="min-width:160px;"></th>
                            </tr>
                            <foreach name="users" item="user">
                                <tr>
                                    <td>
                                        {$user['username']}
                                    </td>
                                    <td>
                                        <if condition="empty($user['role']['issystem'])">
                                            <a href="{:U('control/acl/roles?id=' . $user['role']['id'])}">{$user['role']['title']}</a>
                                        <else/>
                                            <span class="label label-default">{$user['role']['title']}</span>
                                        </if>
                                    </td>
                                    <td>
                                        <if condition="$user['status'] == '-1'">
                                            <span class="label label-warning">已禁用</span>
                                        <else/>
                                            <span class="label label-success">启用</span>
                                        </if>
                                    </td>
                                    <td>
                                        <if condition="$user['uid'] == '1'">
                                        <else/>
                                            <div class="btn-group btn-group-sm">
                                                <a class="btn btn-default" href="{:U('control/user/modify?uid=' . $user['uid'])}">编辑</a>
                                                <a class="btn btn-default" href="{:U('control/user/delete?uid=' . $user['uid'])}">删除</a>
                                            </div>
                                        </if>
                                    </td>
                                </tr>
                            </foreach>
                        </table>
                    </div>
                <else/>
                    <div class="alert alert-info">没有相关的用户记录</div>
                </if>
            </div>
        </div>
    </div>
</div>
<include file="Common/footer-control" />
